#include <iostream>
#include <omp.h>
#include "queue_consensus.h"
#include "../lfqueue/queue.cpp"
#include "../lfqueue/lfqueue.cpp"
#include "cas_consensus.h"

using std::cout;


int main() {
	int N = 2;
	omp_set_num_threads(N);
	Queue<bool> queue;
	LFQueue<bool> queue_safe;
	
	QueueConsensus<int> con(&queue, N);
	QueueConsensus<int> con_safe(&queue_safe, N);
	
	CasConsensus<int> con_cas(N);
	
#pragma omp parallel
	{
		size_t i = omp_get_thread_num();
		con.Propose(10 * i);
		con_safe.Propose(10 * i);

		con_cas.Propose(10 * i);

		cout << "con desided: " << con.Decide() << std::endl;
		cout << "con_safe desided: " << con_safe.Decide() << std::endl;
		cout << "con_cas desided: " << con_cas.Decide() << std::endl;
			
	}	
}
